<!doctype html>
<html class="no-js" lang="en">
	<head>
		<meta charset="utf-8">
		<meta http-equiv="x-ua-compatible" content="ie=edge">
		<title>Home</title>
		<meta name="description" content="">
		<meta name="viewport" content="width=device-width, initial-scale=1">

		<link rel="shortcut icon" type="image/x-icon" href="/static/home/img/favicon.ico">
		<!-- Place favicon.ico in the root directory -->

		<!-- Google Font -->

		<!-- <link href='https://fonts.googleapis.com/css?family=Lato:400,700,900' rel='stylesheet' type='text/css'>
		<link href='https://fonts.googleapis.com/css?family=Bree+Serif' rel='stylesheet' type='text/css'> -->




		<!-- all css here -->
		<!-- bootstrap v3.3.6 css -->
		<link rel="stylesheet" href="/static/home/css/bootstrap.min.css">
		<!-- animate css -->
		<link rel="stylesheet" href="/static/home/css/animate.css">
		<!-- jquery-ui.min css -->
		<link rel="stylesheet" href="/static/home/css/jquery-ui.min.css">
		<!-- meanmenu css -->
		<link rel="stylesheet" href="/static/home/css/meanmenu.min.css">
		<!-- nivo-slider css -->
		<link rel="stylesheet" href="/static/home/lib/css/nivo-slider.css">
		<link rel="stylesheet" href="/static/home/lib/css/preview.css">
		<!-- slick css -->
		<link rel="stylesheet" href="/static/home/css/slick.css">
		<!-- lightbox css -->
		<link rel="stylesheet" href="/static/home/css/lightbox.min.css">
		<!-- material-design-iconic-font css -->
		<link rel="stylesheet" href="/static/home/css/material-design-iconic-font.css">
		<!-- All common css of theme -->
		<link rel="stylesheet" href="/static/home/css/default.css">
		<!-- style css -->
		<link rel="stylesheet" href="/static/home/style.css">
        <!-- shortcode css -->
        <link rel="stylesheet" href="/static/home/css/shortcode.css">
		<!-- responsive css -->
		<link rel="stylesheet" href="/static/home/css/responsive.css">
		<!-- modernizr css -->
		<script src="/static/home/js/vendor/modernizr-2.8.3.min.js"></script>
	</head>
	<body>
		<!-- WRAPPER START -->
		<div class="wrapper">

			<!-- Mobile-header-top Start -->
			<div class="mobile-header-top hidden-lg hidden-md hidden-sm">
				<div class="container">
					<div class="row">
						<div class="col-xs-12">
							<!-- header-search-mobile start -->
							<div class="header-search-mobile">
								<div class="table">
									<div class="table-cell">
										<ul>
											<li><a class="search-open" href="#"><i class="zmdi zmdi-search"></i></a></li>
											<li><a href="/login"><i class="zmdi zmdi-lock"></i></a></li>
											<li><a href="my-account.html"><i class="zmdi zmdi-account"></i></a></li>
											<li><a href="wishlist.html"><i class="zmdi zmdi-favorite"></i></a></li>
										</ul>
									</div>
								</div>
							</div>
							<!-- header-search-mobile start -->
						</div>
					</div>
				</div>
			</div>
			<!-- Mobile-header-top End -->
			<!-- HEADER-AREA START -->
			<header id="sticky-menu" class="header">
				<div class="header-area">
					<div class="container-fluid">
						<div class="row">
							<div class="col-sm-4 col-sm-offset-4 col-xs-7">
								<div class="logo text-center">
									<a href="/"><img src="/static/home/img/logo/logo.png " alt="" /></a>
								</div>
							</div>
							<div class="col-sm-4 col-xs-5">
								<div class="mini-cart text-right">
<?php
	$is_user=DB::table('user')->where("user_name",Cookie::get('u_name'))->first();
	$user_cart=DB::table('shopcar as s')->select("s.*","g.good_name","g.good_price","g.main_img")->leftJoin('good as g',"s.good_id","g.good_id")->where("s.user_id",$is_user->user_id)->limit(6)->get();
	$total_arr=DB::table('shopcar as s')->select("s.*","g.good_name","g.good_price","g.main_img")->leftJoin('good as g',"s.good_id","g.good_id")->where("s.user_id",$is_user->user_id)->get();
	$total = 0;
	foreach ($total_arr as $v){
		$total += $v->good_price * $v->number;
	}
	$count=DB::table('shopcar as s')->select("s.*","g.good_name","g.good_price","g.main_img")->leftJoin('good as g',"s.good_id","g.good_id")->where("s.user_id",$is_user->user_id)->count("s.id");
	// dd($user_cart);
	
?>
								<!-- 用户名：{{Cookie::get('u_name')}} -->
									<ul>
										<li>
											<a class="cart-icon" href="#">
												<i class="zmdi zmdi-shopping-cart"></i>
												<span>{{$count}}</span>
											</a>
											<div class="mini-cart-brief text-left">
												<div class="cart-items">
													<p class="mb-0">您的购物车里共有<span>{{$count}}件</span> 商品</p>
												</div>
												<div class="all-cart-product clearfix">
													@foreach($user_cart as $v)
													<div class="single-cart clearfix">
														<div class="cart-photo">
															<a href="#"><img src="/uploads/{{$v->main_img}}" alt="" /></a>
														</div>
														<div class="cart-info">
															<h5><a href="#">{{$v->good_name}}</a></h5>
															<p class="mb-0">单价 : $ {{$v->good_price}}</p>
															<p class="mb-0">数量 : {{$v->number}} </p>
															<span class="cart-delete"><a href="#"><i class="zmdi zmdi-close"></i></a></span>
														</div>
													</div>
													@endforeach
													<!-- <div class="single-cart clearfix">
														<div class="cart-photo">
															<a href="#"><img src="/static/home/img/cart/2.jpg" alt="" /></a>
														</div>
														<div class="cart-info">
															<h5><a href="#">dummy product name</a></h5>
															<p class="mb-0">Price : $ 300.00</p>
															<p class="mb-0">Qty : 01 </p>
															<span class="cart-delete"><a href="#"><i class="zmdi zmdi-close"></i></a></span>
														</div>
													</div> -->
												</div>
												<div class="cart-totals">
													<h5 class="mb-0">Total <span class="floatright">${{$total}}</span></h5>
												</div>
												<div class="cart-bottom  clearfix">
													<a href="/shopcart" class="button-one floatleft text-uppercase" data-text="View cart">View cart</a>
													<a href="/checkout" class="button-one floatright text-uppercase" data-text="Check out">Check out</a>
												</div>
											</div>
										</li>
									</ul>
								</div>
							</div>
						</div>
					</div>
				</div>
				<!-- MAIN-MENU START -->
				<div class="menu-toggle hamburger hamburger--emphatic hidden-xs">
					<div class="hamburger-box">
						<div class="hamburger-inner"></div>
					</div>
				</div>
				<div class="main-menu  hidden-xs">
					<nav>
						<ul>
							<li><a href="/">首页</a></li>
							<li><a href="/shop">商品中心</a></li>
							<li><a href="/shopcart">购物车</a></li>
							<li><a href="/blog">看看博客</a></li>
							<li><a href="#">页面中心</a>
								<div class="sub-menu menu-scroll">
									<ul>
										<li class="menu-title">页面中心</li>
										<li><a href="/shop">商品中心</a></li>
										<li><a href="/s_product">商品详情</a></li>
										<li><a href="/shopcart">购物车</a></li>
										<li><a href="/wishlist">心愿单</a></li>
										<li><a href="/checkout">收获地址</a></li>
										<li><a href="/order">订单中心</a></li>
										<li><a href="/my_account">我的账户</a></li>
										<li><a href="/404">404</a></li>
										<li><a href="/blog">博客</a></li>
										<li><a href="/single_blog">博客详情</a></li>
										<li><a href="/about">关于我们</a></li>
										<li><a href="/contact">联系我们</a></li>
									</ul>
								</div>
							</li>
							<li><a href="/about">关于我们</a></li>
							<li><a href="/contact">联系我们</a></li>
							@if(empty(Cookie::get('u_name')))
							<li><a href="/login">登录/ 注册</a></li>
							@endif
							@if(!empty(Cookie::get('u_name')))
							<li><a href="/my_account">个人中心</a></li>
							<li><a href="/login_out">退出登录</a></li>
							@endif
						</ul>
					</nav>
				</div>
				<!-- MAIN-MENU END -->
			</header>
			<!-- HEADER-AREA END -->
			<!-- Mobile-menu start -->
			<div class="mobile-menu-area">
				<div class="container-fluid">
					<div class="row">
						<div class="col-xs-12 hidden-lg hidden-md hidden-sm">
							<div class="mobile-menu">
								<nav id="dropdown">
									<ul>
									<li><a href="/">首页</a></li>
									<li><a href="/shop">商品中心</a></li>
									<li><a href="/cart">购物车</a></li>
									<li><a href="/blog">看看博客</a></li>
									<li><a href="#">页面中心</a>
											<ul>
												<li class="menu-title">页面中心</li>
												<li><a href="/shop">商品中心</a></li>
												<li><a href="/s_product">商品详情</a></li>
												<li><a href="/cart">购物车</a></li>
												<li><a href="/wishlist">Wishlist</a></li>
												<li><a href="/checkout">Checkout</a></li>
												<li><a href="/order">Order</a></li>
												<li><a href="/login">登录/注册</a></li>
												<li><a href="/my_account">我的账户</a></li>
												<li><a href="/404">404</a></li>
												<li><a href="/blog">博客</a></li>
												<li><a href="/single_blog">博客详情</a></li>
												<li><a href="/about">关于我们</a></li>
												<li><a href="/contact">联系我们</a></li>
											</ul>
										</li>
										<li><a href="/about">关于我们</a></li>
										<li><a href="/contact">联系我们</a></li>
										@if(empty(Cookie::get('u_name')))
										<li><a href="/login">登录/ 注册</a></li>
										@endif
										@if(!empty(Cookie::get('u_name')))
										<li><a href="/my_account">个人中心</a></li>
										<li><a href="/login_out">退出登录</a></li>
										@endif
									</ul>
								</nav>
							</div>
						</div>
					</div>
				</div>
			</div>
			<!-- Mobile-menu end -->